/**
 * @program: LeetCode
 * @description: LeetCode : 剑指 Offer 65. 不用加减乘除做加法
 * @author: WXY
 * @create: 2022-12-11 15:51
 * @Version 1.0
 **/


public class Num065_add {
    public static int add(int a, int b) {
        if (b == 0) {
            return a;
        }
        int jinWei = (a & b) << 1;
        int noJinWeiSum = a ^ b;
        return add(noJinWeiSum, jinWei);
    }

    public static void main(String[] args) {
        int num = add(1, 3);
        System.out.println(num);

    }
}
